<?php
/**
 * 商品基本信息校验
 */

namespace app\common\validate;


class ProductValidate extends BaseValidate
{
    protected $rule = [
        'name'  => 'require|min:2|max:50',
        'categoryIds'  => 'require',
        'spec_type' => 'require|between:10,20',
        'sort' => 'require|between:0,9999'
    ];

    protected $message = [
        'name' => '商品名称不能为空',
        'categoryIds' => '商品分类不能为空',
        'spec_type' => '规格类型不能为空',
        'sort' => '排序数值范围是1～9999'
    ];
}